//
//  LNHomeViewModel.m
//  LNDevelopExample
//
//  Created by wwww on 2018/9/7.
//  Copyright © 2018年 淘发现1iOS. All rights reserved.
//

#import "LNHomeViewModel.h"
#import "LNBanner.h"
#import "LNFood.h"

@interface LNHomeViewModel()

@property (nonatomic,readwrite) RACCommand *testCommand;
@end

@implementation LNHomeViewModel

- (void)initialize{
    [super initialize];
    //标题
    LNThemeTabItem *Item = [[LNTheme shareThemeManager] getThemeWithTag:LNTabBarItemTagTypeHome];
    self.title = Item.title;
    //隐藏分割线
    self.prefersNavigationBarBottomLineHidden = YES;
    
    // 多段数据
    self.shouldMultiSections = YES;
    
    //上下拉刷新
    self.shouldPullUpToLoadMore = YES;
    self.shouldPullDownToRefresh = YES;
    
    //数据源
   // self.dataSource = @[@[@"http://i2.chuimg.com/a7b7515e0d3211e7947d0242ac110002_1280w_850h.jpg?imageView2/1/w/490/h/260/interlace/1/q/90",@"http://i2.chuimg.com/fb506d988b6211e6b87c0242ac110003_1620w_1080h.jpg?imageView2/1/w/490/h/260/interlace/1/q/90",@"http://i2.chuimg.com/0225cf728a2411e6a9a10242ac110002_1400w_858h.jpg?imageView2/1/w/490/h/260/interlace/1/q/90",@"http://i2.chuimg.com/6907802c0f004d2b868668c945437fdf_1874w_1874h.jpg?imageView2/1/w/490/h/260/interlace/1/q/90"],@[],@[],@[]];
    
    self.testCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
       
        /// 1. 配置参数
        NSMutableDictionary *easyDict = [NSMutableDictionary dictionary];
        /// 2. 配置参数模型
        FMHttpRequest *req = [FMHttpRequest urlParametersWithMethod:HTTTP_METHOD_POST path:@"Room/GetHotLive_v2" parameters:easyDict];
        
        return [[FMARCNetwork sharedInstance] requestNetworkData:req];
    }];
    
    
    [self.testCommand.executionSignals.switchToLatest subscribeNext:^(id x) {
        
    }];
}




@end
